home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1031 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.2 KB

  1. Path: fido.asd.sgi.com!austern
  2. From: vandevod@cs.rpi.edu (David Vandevoorde)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: STL's operators template<>bool operator<(...) hurt!!!!!!!!!
  5. Date: 10 Apr 1996 14:10:10 PDT
  6. Organization: RPI Computer Science
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <xsohguru87h.fsf@avs.cs.rpi.edu>
  9. References: <9604072103.AA09560@avs.cs.rpi.edu>
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. X-Original-Date: 10 Apr 1996 16:37:06 -0400
  12. In-Reply-To: opetrova@blue.weeg.uiowa.edu's message of 08 Apr 1996 10:15:32 PDT
  13. X-Newsreader: Gnus v5.1
  14. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  15.     iQBVAwUBMWwjs0y4NqrwXLNJAQE9cgIAoxAIqycxyXpnGKapuBmaPI9cvvAFUAgK
  16.     glQuqodDjSzosLt5bUKx0o2vVlpxr2/kGdK2G1pmx47O3ZN5K4kSgg==
  17.     =SeJs
  18. Originator: austern@isolde.mti.sgi.com
  19.  
  20. >>>>> "OP" == O Petrova <opetrova@blue.weeg.uiowa.edu> writes:
  21. [...]
  22. OP> class EExpression
  23. OP>     {
  24. OP>     public:
  25. OP>             EExpression( int );
  26. OP>             EExpression( double );
  27. OP>     public:
  28. OP>       friend EExpression operator+(const EExpression&, const EExpression&);
  29. OP>       friend EExpression operator<(const EExpression&, const EExpression&);
  30. OP>     .....
  31. OP>     public:
  32. OP>              string fSQLString;
  33. OP>     };
  34.  
  35. OP> void main()
  36. OP>     {
  37. OP>    // Works fine w/o STL, doesn't with it
  38. OP>    // because of template<class T> bool operator> in function.h
  39. OP>    //                              ^^^^
  40. OP>     EExpression a = EExpression( 2 ) > 4; 
  41. OP>     ....
  42. OP>     }
  43.  
  44. OP> I don't like that at all. I think that those operators should be
  45. OP> removed form STL.
  46.  
  47. Your prayers have been heard... almost ;^)
  48.  
  49. The relational operator templates of the standard library have been moved
  50. to their own subnamespace (::std::rel_ops, I believe --- not sure). This
  51. is the only case of a standard sub-::std namespace (no pun intended :).
  52.  
  53. This makes it easy to avoid the problem above (if you have a sufficiently
  54. close implementation that is).
  55.  
  56.     Daveed
  57. ---
  58. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  59.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  60.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  61.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  62.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  63. ]
  64.